{extend name="public/base" /}
{block name="body"}
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">
                <a href="javascript:history.back();" class="lbtn-go-back layui-inline"><i class="layui-icon layui-icon-return"></i></a>
                <span class="layui-inline">新增文章内容</span>
            </div>
            <div class="layui-card-body">
                    <form action="{:url('?cid='.$cid)}" method="post"  class="layui-form">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this">基本信息</li>
                                <li>文章设置</li>
                            </ul>
                            <div class="layui-tab-content layui-row">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">标题</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="title" placeholder="" value="" lay-verify="required" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">文章分类</label>
                                        <div class="layui-input-inline">
                                            <select name="category_id">
                                                {foreach $DocumentCategoryList as $key=>$vo }
                                                <option value="{$vo.id}" {$vo['id']==$cid?"selected":""}>{$vo.title}</option>
                                                {/foreach}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">封面</label>
                                        <div class="layui-input-block">
                                            <div class="zz-upload" name="cover_path"></div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">文章作者</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="writer" placeholder="" value="{$member.username}" lay-verify="required" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">是否显示</label>
                                        <div class="layui-input-block">
                                            {volist name="IsShowList" id="title"}
                                            <input {$i==2?'checked':''} name="display" title="{$title}" type="radio" value="{$key}">
                                            {/volist}
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">文章内容</label>
                                        <div class="layui-input-block">
                                            <script style="height:400px" id="editor" name="content" type="text/plain"></script>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">网站关键词</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="keywords" placeholder="" value="" lay-verify="" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">网站描述</label>
                                        <div class="layui-input-block">
                                            <textarea name="description" placeholder="" lay-verify="" class="layui-textarea"></textarea>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">是否推荐</label>
                                        <div class="layui-input-block">
                                            {volist name="IsrecommendList" id="title"}
                                            <input {$i==1?'checked':''} name="isrecommend" title="{$title}" type="radio" value="{$key}">
                                            {/volist}
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">是否置顶</label>
                                        <div class="layui-input-block">
                                            {volist name="IstopList" id="title"}
                                            <input {$i==1?'checked':''} name="istop" title="{$title}" type="radio" value="{$key}">
                                            {/volist}
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">外链</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="link_str" placeholder="" value="" lay-verify="" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">浏览量</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="view" placeholder="" value="0" lay-verify="number" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">排序</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sort" placeholder="" value="99" lay-verify="required|number" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item layui-layout-admin">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn" lay-submit="" lay-filter="zz-btn-submit">立即提交</button>
                                <button type="button" class="layui-btn layui-btn-primary zz-btn-cancel">取消</button>
                            </div>
                        </div>
                    </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="__LIB__/ueditor/ueditor.config.js"></script>
<script src="__LIB__/ueditor/ueditor.all.min.js"></script>
<script src="__LIB__/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    var ue = UE.getEditor('editor',{
        serverUrl: "{$_SERVER['PHP_SELF'].url('Ueditor/index')}",
    });
</script>

<script src="__JS__/upload.js"></script>
{/block}